<?php 
session_start();
function objectToArray($d) {
        if (is_object($d)) {
                // Gets the properties of the given object
                // with get_object_vars function
                $d = get_object_vars($d);
        }

        if (is_array($d)) {
                /*
                * Return array converted to object
                * Using __FUNCTION__ (Magic constant)
                * for recursive call
                */
                return array_map(__FUNCTION__, $d);
        }
        else {
                // Return array
                return $d;
        }
}
class product extends CI_Controller  {

        /**
        * Index Page for this controller.
        *
        * Maps to the following URL
        * 		http://example.com/index.php/welcome
        *	- or -  
        * 		http://example.com/index.php/welcome/index
        *	- or -
        * Since this controller is set as the default controller in 
        * config/routes.php, it's displayed at http://example.com/
        *
        * So any other public methods not prefixed with an underscore will
        * map to /index.php/welcome/<method_name>
        * @see http://codeigniter.com/user_guide/general/urls.html
        */
       private $_configs = null;
       function __construct()
        {
            parent::__construct();
            $this->load->helper('url');
            $this->load->library('javascript');
            $this->load->library('session');
            $this->load->library('smarty3','','smarty');
            
        }
        public function index()
	{
            
            
                $array_para = $this->uri->ruri_to_assoc();
		if(isset($array_para['id'])){
			$id = intval($array_para['id']);
			if($id>0){
				$this->session->set_userdata('search_id', $id);
			}
		}
		// css_files
		$css_files = array(
			base_url().TEMPLATE_DIR.'css/ui/ui.jqgrid.css'
		);
		// js_files
		$js_files = array(
			base_url().TEMPLATE_DIR.'js/i18n/grid.locale-vi.js',
			base_url().TEMPLATE_DIR.'js/jquery.jqGrid.min.js'
		);
		// Nap cac module tai day
		// nap theme
		require_once(APPPATH.'modules/backend/theme.php');
		// nap slider bar
		require_once(APPPATH.'modules/backend/slider_bar.php');
		// nap menutop
		require_once(APPPATH.'modules/backend/top_menu.php');
		// nap history url
		require_once(APPPATH.'modules/backend/history.php');
		$data_obj = new Product_model();
		// Nap cac thong so de khoi tao jqgrid
		$jqgrid = array();
		$jqgrid['id'] = 'jqgrid';
		$jqgrid['pager'] = 'pagered'; // id pager
		$jqgrid['caption'] = $data_obj->localize_label('manager');
		$jqgrid['url_metadata'] = site_url($this->router->directory.'product/jqgrid_jsoninit');
		$jqgrid['url_data'] = site_url($this->router->directory.'product/jqgrid_jsondata');
		$jqgrid['url_create'] = site_url($this->router->directory.'data/create');
		$jqgrid['url_edit'] = site_url($this->router->directory.'data/edit');
		$jqgrid['url_delete'] = site_url($this->router->directory.'data/delete');
		$this->smarty->assign('jqgrid', $jqgrid);
		// Khoi tao luoi
		$jqgrid_init = $this->smarty->get_contents('templates/js/jqgrid');
		$js_text = array($jqgrid_init);
		// Nap cac file css va js
		$this->smarty->assign('css_files', $css_files);
		$this->smarty->assign('js_files', $js_files);
		$this->smarty->assign('js_text', $js_text);
		$this->smarty->assign('tieude', $data_obj->localize_label('manager'));
                $this->smarty->assign('tieude', 'Quản lý sản phẩm đấu giá');
		// view
		$this->smarty->view('backend/data/jqgrid');
                
                $this->smarty->display('Template_');
                //$this->jqgrid()
                
                
                
                ?>
    
                    <?
                
                
                return;
                
		
	}
        function get_pars(){
            $this->session->all_userdata();
            echo "<pre>";
            echo  print_r($this->session->userdata('msg'));
            echo "</pre>";
        }
        function jqgrid_data(){
            $this->session->all_userdata();
            $this->session->set_userdata('msg', $_REQUEST);
            $this->load->model('admin-planners/product_model','product_model');
            $result=$this->product_model->gettotal_rows();
            
            
            $rows=$result['rows'];
            
            $products = null;
            // get data and store in a json array
            foreach ($rows as $row) {
                    $products[] = array(
                            'id' => $row->id,
                            'name' => $row->name,
                            'status' => $row->status,
                            'startdate' => $row->startdate,
                            'enddate' => $row->enddate,
                            'insert' => $row->insert
                    );
            }
            
            $data[] = array(
                'TotalRows' => $result['total_rows'],
                'Rows' => $products
            );
            echo json_encode($data);
        }
        function jqgrid(){
            ?>
    <link rel="stylesheet" href="<?=base_url()?>jqwidgets-ver2.3.1/jqwidgets/styles/jqx.base.css" type="text/css" />
    <link rel="stylesheet" href="<?=base_url()?>jqwidgets-ver2.3.1/jqwidgets/styles/jqx.classic.css" type="text/css" />
    <script type="text/javascript" src="<?=base_url()?>jqwidgets-ver2.3.1/scripts/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="<?=base_url()?>jqwidgets-ver2.3.1/jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="<?=base_url()?>jqwidgets-ver2.3.1/jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="<?=base_url()?>jqwidgets-ver2.3.1/jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="<?=base_url()?>jqwidgets-ver2.3.1/jqwidgets/jqxmenu.js"></script>
    <script type="text/javascript" src="<?=base_url()?>jqwidgets-ver2.3.1/jqwidgets/jqxgrid.js"></script>
    <script type="text/javascript" src="<?=base_url()?>jqwidgets-ver2.3.1/jqwidgets/jqxgrid.selection.js"></script>	
    <script type="text/javascript" src="<?=base_url()?>jqwidgets-ver2.3.1/jqwidgets/jqxgrid.filter.js"></script>	
    <script type="text/javascript" src="<?=base_url()?>jqwidgets-ver2.3.1/jqwidgets/jqxgrid.sort.js"></script>		
    <script type="text/javascript" src="<?=base_url()?>jqwidgets-ver2.3.1/jqwidgets/jqxdata.js"></script>	
    <script type="text/javascript" src="<?=base_url()?>jqwidgets-ver2.3.1/jqwidgets/jqxlistbox.js"></script>	
    <script type="text/javascript" src="<?=base_url()?>jqwidgets-ver2.3.1/jqwidgets/jqxgrid.pager.js"></script>		
    <script type="text/javascript" src="<?=base_url()?>jqwidgets-ver2.3.1/jqwidgets/jqxdropdownlist.js"></script>	
    <script type="text/javascript">
        $(document).ready(function () {
            // prepare the data
            var theme = 'classic';
      
            var source =
            {
                 datatype: "json",
                 datafields: [
					 { name: 'ShippedDate', type: 'date'},
					 { name: 'ShipName'},
					 { name: 'ShipAddress'},
					 { name: 'ShipCity'},
					 { name: 'ShipCountry'}
                ],
			    url: 'http://localhost/ngao2/jqwidgets-ver2.3.1/phpdemos/server_side_grid_filtering_and_sorting_and_paging/data.php',
				filter: function()
				{
					// update the grid and send a request to the server.
					$("#jqxgrid").jqxGrid('updatebounddata');
				},
				sort: function()
				{
					// update the grid and send a request to the server.
					$("#jqxgrid").jqxGrid('updatebounddata');
				},
				root: 'Rows',
				beforeprocessing: function(data)
				{		
					source.totalrecords = data[0].TotalRows;					
				}
            };		
            var dataadapter = new $.jqx.dataAdapter(source, {
                                loadError: function(xhr, status, error)
                                {
                                        alert(error);
                                }
                        }
                );
	
            // initialize jqxGrid
            $("#jqxgrid").jqxGrid(
            {	
                
                source: dataadapter,
                theme: theme,
                filterable: true,
                sortable: true,
                autoheight: false,
                pageable: true,
                pagesize:20,
                virtualmode: true,
                rendergridrows: function(obj)
                {
                            return obj.data;    
                },
                columns: [
                      { text: 'Shipped Date', datafield: 'ShippedDate', cellsformat: 'yyyy-MM-dd', width: 200 },
                      { text: 'Ship Name', datafield: 'ShipName', width: 200 },
                      { text: 'Address', datafield: 'ShipAddress', width: 180 },
                      { text: 'City', datafield: 'ShipCity', width: 100 },
                      { text: 'Country', datafield: 'ShipCountry', width: 140 }
                  ]
            });
        });
    </script>
    <div id='jqxWidget'">
        <div id="jqxgrid"></div>
    </div>
                <?
        }
        function jqgrid_jsoninit(){
		if(IS_AJAX){
			$data_obj = new Product_model();
			$metadata = $data_obj->jqgrid_metadata();
			echo json_encode($metadata);
		}
	}
        function jqgrid_jsondata() {
        if (IS_AJAX) {
            // <field>..., level, left_id, isleaf (true, false), expand (true, false)
            $group_obj = new Product_model();
            $search = $this->input->post('_search');
            // Cau hinh tim kiem, sap xep tren obj quan he
            $relative_search = array();
            $relative_key = array_keys($relative_search);
            if ($search == 'true') {
                $filters = json_decode($this->input->post('filters'));
                if (!empty($filters->groupOp) && !empty($filters->rules)) {
                    $group_obj->group_start();
                    if ($filters->groupOp == 'OR') {
                        foreach ($filters->rules as $rules) {
                            $searchField = $rules->field;
                            $searchOper = $rules->op; // eq, ne, 'gt', 'ge', 'lt', 'le', bw, bn, ew, en, cn, nc, nu, nn, in, ni
                            $searchString = $rules->data;
                            if (in_array($searchField, $relative_key) && $searchString != '') {
                                if ($searchOper == 'eq') {
                                    $group_obj->or_where_related($searchField, $relative_search[$searchField], $searchString);
                                } elseif ($searchOper == 'ne') {
                                    $group_obj->or_where_related($searchField, $relative_search[$searchField] . ' !=', $searchString);
                                } elseif ($searchOper == 'gt') {
                                    $group_obj->or_where_related($searchField, $relative_search[$searchField] . ' >', $searchString);
                                } elseif ($searchOper == 'ge') {
                                    $group_obj->or_where_related($searchField, $relative_search[$searchField] . ' >=', $searchString);
                                } elseif ($searchOper == 'lt') {
                                    $group_obj->or_where_related($searchField, $relative_search[$searchField] . ' <', $searchString);
                                } elseif ($searchOper == 'le') {
                                    $group_obj->or_where_related($searchField, $relative_search[$searchField] . ' <=', $searchString);
                                } elseif ($searchOper == 'bw') {
                                    $group_obj->or_like_related($searchField, $relative_search[$searchField], $searchString, 'after');
                                } elseif ($searchOper == 'bn') {
                                    $group_obj->or_not_like_related($searchField, $relative_search[$searchField], $searchString, 'after');
                                } elseif ($searchOper == 'ew') {
                                    $group_obj->or_like_related($searchField, $relative_search[$searchField], $searchString, 'before');
                                } elseif ($searchOper == 'en') {
                                    $group_obj->or_not_like_related($searchField, $relative_search[$searchField], $searchString, 'before');
                                } elseif ($searchOper == 'cn') {
                                    $group_obj->or_like_related($searchField, $relative_search[$searchField], $searchString, 'both');
                                } elseif ($searchOper == 'nc') {
                                    $group_obj->or_not_like_related($searchField, $relative_search[$searchField], $searchString, 'both');
                                } elseif ($searchOper == 'nu') {
                                    $group_obj->or_where_related($searchField, $relative_search[$searchField] . ' IS NULL');
                                } elseif ($searchOper == 'nn') {
                                    $group_obj->or_where_related($searchField, $relative_search[$searchField] . ' IS NOT NULL');
                                } elseif ($searchOper == 'in') {
                                    $group_obj->or_where_in_related($searchField, $relative_search[$searchField], explode(';', $searchString));
                                } elseif ($searchOper == 'ni') {
                                    $group_obj->or_where_not_in_related($searchField, $relative_search[$searchField], explode(';', $searchString));
                                }
                            } elseif (in_array($searchField, $group_obj->fields) && $searchString != '') {
                                if ($searchOper == 'ne') {
                                    $group_obj->or_where($searchField, $searchString);
                                } elseif ($searchOper == 'ne') {
                                    $group_obj->or_where($searchField . ' !=', $searchString);
                                } elseif ($searchOper == 'gt') {
                                    $group_obj->or_where($searchField . ' >', $searchString);
                                } elseif ($searchOper == 'ge') {
                                    $group_obj->or_where($searchField . ' >=', $searchString);
                                } elseif ($searchOper == 'lt') {
                                    $group_obj->or_where($searchField . ' <', $searchString);
                                } elseif ($searchOper == 'le') {
                                    $group_obj->or_where($searchField . ' <=', $searchString);
                                } elseif ($searchOper == 'bw') {
                                    $group_obj->or_like($searchField, $searchString, 'after');
                                } elseif ($searchOper == 'bn') {
                                    $group_obj->or_not_like($searchField, $searchString, 'after');
                                } elseif ($searchOper == 'ew') {
                                    $group_obj->or_like($searchField, $searchString, 'before');
                                } elseif ($searchOper == 'en') {
                                    $group_obj->or_not_like($searchField, $searchString, 'before');
                                } elseif ($searchOper == 'cn') {
                                    $group_obj->or_like($searchField, $searchString, 'both');
                                } elseif ($searchOper == 'nc') {
                                    $group_obj->or_not_like($searchField, $searchString, 'both');
                                } elseif ($searchOper == 'nu') {
                                    $group_obj->or_where($searchField . ' IS NULL');
                                } elseif ($searchOper == 'nn') {
                                    $group_obj->or_where($searchField . ' IS NOT NULL');
                                } elseif ($searchOper == 'in') {
                                    $group_obj->or_where_in($searchField, explode(';', $searchString));
                                } elseif ($searchOper == 'ni') {
                                    $group_obj->or_where_not_in($searchField, explode(';', $searchString));
                                }
                            }
                        }
                    } else { // AND
                        foreach ($filters->rules as $rules) {
                            $searchField = $rules->field;
                            $searchOper = $rules->op; // eq, ne, 'gt', 'ge', 'lt', 'le', bw, bn, ew, en, cn, nc, nu, nn, in, ni
                            $searchString = $rules->data;
                            if (in_array($searchField, $relative_key) && $searchString != '') {
                                if ($searchOper == 'eq') {
                                    $group_obj->where_related($searchField, $relative_search[$searchField], $searchString);
                                } elseif ($searchOper == 'ne') {
                                    $group_obj->where_related($searchField, $relative_search[$searchField] . ' !=', $searchString);
                                } elseif ($searchOper == 'gt') {
                                    $group_obj->where_related($searchField, $relative_search[$searchField] . ' >', $searchString);
                                } elseif ($searchOper == 'ge') {
                                    $group_obj->where_related($searchField, $relative_search[$searchField] . ' >=', $searchString);
                                } elseif ($searchOper == 'lt') {
                                    $group_obj->where_related($searchField, $relative_search[$searchField] . ' <', $searchString);
                                } elseif ($searchOper == 'le') {
                                    $group_obj->where_related($searchField, $relative_search[$searchField] . ' <=', $searchString);
                                } elseif ($searchOper == 'bw') {
                                    $group_obj->like_related($searchField, $relative_search[$searchField], $searchString, 'after');
                                } elseif ($searchOper == 'bn') {
                                    $group_obj->not_like_related($searchField, $relative_search[$searchField], $searchString, 'after');
                                } elseif ($searchOper == 'ew') {
                                    $group_obj->like_related($searchField, $relative_search[$searchField], $searchString, 'before');
                                } elseif ($searchOper == 'en') {
                                    $group_obj->not_like_related($searchField, $relative_search[$searchField], $searchString, 'before');
                                } elseif ($searchOper == 'cn') {
                                    $group_obj->like_related($searchField, $relative_search[$searchField], $searchString, 'both');
                                } elseif ($searchOper == 'nc') {
                                    $group_obj->not_like_related($searchField, $relative_search[$searchField], $searchString, 'both');
                                } elseif ($searchOper == 'nu') {
                                    $group_obj->where_related($searchField, $relative_search[$searchField] . ' IS NULL');
                                } elseif ($searchOper == 'nn') {
                                    $group_obj->where_related($searchField, $relative_search[$searchField] . ' IS NOT NULL');
                                } elseif ($searchOper == 'in') {
                                    $group_obj->where_in_related($searchField, $relative_search[$searchField], explode(';', $searchString));
                                } elseif ($searchOper == 'ni') {
                                    $group_obj->where_not_in_related($searchField, $relative_search[$searchField], explode(';', $searchString));
                                }
                            } elseif (in_array($searchField, $group_obj->fields) && $searchString != '') {
                                if ($searchOper == 'eq') {
                                    $group_obj->where($searchField, $searchString);
                                } elseif ($searchOper == 'ne') {
                                    $group_obj->where($searchField . ' !=', $searchString);
                                } elseif ($searchOper == 'gt') {
                                    $group_obj->where($searchField . ' >', $searchString);
                                } elseif ($searchOper == 'ge') {
                                    $group_obj->where($searchField . ' >=', $searchString);
                                } elseif ($searchOper == 'lt') {
                                    $group_obj->where($searchField . ' <', $searchString);
                                } elseif ($searchOper == 'le') {
                                    $group_obj->where($searchField . ' <=', $searchString);
                                } elseif ($searchOper == 'bw') {
                                    $group_obj->like($searchField, $searchString, 'after');
                                } elseif ($searchOper == 'bn') {
                                    $group_obj->not_like($searchField, $searchString, 'after');
                                } elseif ($searchOper == 'ew') {
                                    $group_obj->like($searchField, $searchString, 'before');
                                } elseif ($searchOper == 'en') {
                                    $group_obj->not_like($searchField, $searchString, 'before');
                                } elseif ($searchOper == 'cn') {
                                    $group_obj->like($searchField, $searchString, 'both');
                                } elseif ($searchOper == 'nc') {
                                    $group_obj->not_like($searchField, $searchString, 'both');
                                } elseif ($searchOper == 'nu') {
                                    $group_obj->where($searchField . ' IS NULL');
                                } elseif ($searchOper == 'nn') {
                                    $group_obj->where($searchField . ' IS NOT NULL');
                                } elseif ($searchOper == 'in') {
                                    $group_obj->where_in($searchField, explode(';', $searchString));
                                } elseif ($searchOper == 'ni') {
                                    $group_obj->where_not_in($searchField, explode(';', $searchString));
                                }
                            }
                        }
                    }
                    $group_obj->group_end();
                } else {
                    $searchField = $this->input->post('searchField');
                    $searchOper = $this->input->post('searchOper'); // eq, ne, 'gt', 'ge', 'lt', 'le', bw, bn, ew, en, cn, nc, nu, nn, in, ni
                    $searchString = $this->input->post('searchString');
                    if (in_array($searchField, $relative_key)) {
                        if ($searchOper == 'eq') {
                            $group_obj->where_related($searchField, $relative_search[$searchField], $searchString);
                        } elseif ($searchOper == 'ne') {
                            $group_obj->where_related($searchField, $relative_search[$searchField] . ' !=', $searchString);
                        } elseif ($searchOper == 'gt') {
                            $group_obj->where_related($searchField, $relative_search[$searchField] . ' >', $searchString);
                        } elseif ($searchOper == 'ge') {
                            $group_obj->where_related($searchField, $relative_search[$searchField] . ' >=', $searchString);
                        } elseif ($searchOper == 'lt') {
                            $group_obj->where_related($searchField, $relative_search[$searchField] . ' <', $searchString);
                        } elseif ($searchOper == 'le') {
                            $group_obj->where_related($searchField, $relative_search[$searchField] . ' <=', $searchString);
                        } elseif ($searchOper == 'bw') {
                            $group_obj->like_related($searchField, $relative_search[$searchField], $searchString, 'after');
                        } elseif ($searchOper == 'bn') {
                            $group_obj->not_like_related($searchField, $relative_search[$searchField], $searchString, 'after');
                        } elseif ($searchOper == 'ew') {
                            $group_obj->like_related($searchField, $relative_search[$searchField], $searchString, 'before');
                        } elseif ($searchOper == 'en') {
                            $group_obj->not_like_related($searchField, $relative_search[$searchField], $searchString, 'before');
                        } elseif ($searchOper == 'cn') {
                            $group_obj->like_related($searchField, $relative_search[$searchField], $searchString, 'both');
                        } elseif ($searchOper == 'nc') {
                            $group_obj->not_like_related($searchField, $relative_search[$searchField], $searchString, 'both');
                        } elseif ($searchOper == 'nu') {
                            $group_obj->where_related($searchField, $relative_search[$searchField] . ' IS NULL');
                        } elseif ($searchOper == 'nn') {
                            $group_obj->where_related($searchField, $relative_search[$searchField] . ' IS NOT NULL');
                        } elseif ($searchOper == 'in') {
                            $searchString = $searchString;
                            $group_obj->where_in_related($searchField, $relative_search[$searchField], explode(';', $searchString));
                        } elseif ($searchOper == 'ni') {
                            $searchString = $searchString;
                            $group_obj->where_not_in_related($searchField, $relative_search[$searchField], explode(';', $searchString));
                        }
                    } elseif (in_array($searchField, $group_obj->fields)) {
                        if ($searchOper == 'eq') {
                            $group_obj->where($searchField, $searchString);
                        } elseif ($searchOper == 'ne') {
                            $group_obj->where($searchField . ' !=', $searchString);
                        } elseif ($searchOper == 'gt') {
                            $group_obj->where($searchField . ' >', $searchString);
                        } elseif ($searchOper == 'ge') {
                            $group_obj->where($searchField . ' >=', $searchString);
                        } elseif ($searchOper == 'lt') {
                            $group_obj->where($searchField . ' <', $searchString);
                        } elseif ($searchOper == 'le') {
                            $group_obj->where($searchField . ' <=', $searchString);
                        } elseif ($searchOper == 'bw') {
                            $group_obj->like($searchField, $searchString, 'after');
                        } elseif ($searchOper == 'bn') {
                            $group_obj->not_like($searchField, $searchString, 'after');
                        } elseif ($searchOper == 'ew') {
                            $group_obj->like($searchField, $searchString, 'before');
                        } elseif ($searchOper == 'en') {
                            $group_obj->not_like($searchField, $searchString, 'before');
                        } elseif ($searchOper == 'cn') {
                            $group_obj->like($searchField, $searchString, 'both');
                        } elseif ($searchOper == 'nc') {
                            $group_obj->not_like($searchField, $searchString, 'both');
                        } elseif ($searchOper == 'nu') {
                            $group_obj->where($searchField . ' IS NULL');
                        } elseif ($searchOper == 'nn') {
                            $group_obj->where($searchField . ' IS NOT NULL');
                        } elseif ($searchOper == 'in') {
                            $searchString = $searchString;
                            $group_obj->where_in($searchField, explode(';', $searchString));
                        } elseif ($searchOper == 'ni') {
                            $searchString = $searchString;
                            $group_obj->where_not_in($searchField, explode(';', $searchString));
                        }
                    }
                }
            } else {
                $id = intval($this->session->userdata('search_id'));
                if ($id > 0) {
                    $group_obj->where('id', $id);
                    $this->session->unset_userdata('search_id');
                }
            }
            // Lay cac truong quan he neu co
            if (!empty($relative_search)) {
                foreach ($relative_search as $key => $value) {
                    $group_obj->include_related($key, $value);
                }
            }
            // Order
            $order = $this->input->post('sidx');
            $order_direct = $this->input->post('sord');
            if (!empty($order) && in_array($order_direct, array('asc', 'desc'))) {
                if (in_array($order, $relative_key)) {
                    $group_obj->order_by($order . '_' . $relative_search[$order], $order_direct);
                } elseif (in_array($order, $group_obj->fields)) {
                    $group_obj->order_by($order, $order_direct);
                }
            }
            // Page
            $page = intval($this->input->post('page'));
            if ($page <= 0)
                $page = 1;

            $num_per_page = intval($this->input->post('rows'));
            if ($num_per_page <= 0)
                $num_per_page = $this->num_per_page;

            $group_obj->get_paged($page, $num_per_page);
            $paged = $group_obj->paged;

            $responce = new Stdclass();
            $responce->page = $paged->current_page; //curent page
            $responce->total = $paged->total_pages; //total page 
            $responce->records = $paged->total_rows; //total record
            $i = 0;
            foreach ($group_obj as $obj) {
                $isLeaf = TRUE;
                $responce->rows[$i]['cell'] = array(
                    // Field
                    $obj->id,
                    $obj->name,
                    $obj->status,
                    // Format
                    NULL,
                    NULL,
                    $isLeaf,
                    false
                );
                $i++;
            }
            echo json_encode($responce);
        }
    }
        
    function data(){
        
    }
        
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */